package service.impl;

import dao.CarouselMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Carousel;
import service.CarouselService;

import java.util.List;

@Service
public class CarouselServiceImpl implements CarouselService {

    @Autowired
    private CarouselMapper carouselMapper;

    @Override
    public List<Carousel> findAll() {
        return carouselMapper.findAll();
    }

    @Override
    public int add(Carousel carousel) {
        return carouselMapper.addCarousel(carousel);
    }

    @Override
    public int update(Carousel carousel) {
        return carouselMapper.updateCarousel(carousel);
    }

    @Override
    public int deleteCarousel(Integer id) {
        return carouselMapper.deleteCarousel(id);
    }

    @Override
    public Carousel findById(Integer id) {
        return carouselMapper.findById(id);
    }
}